package com.example.demo.utils;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor
public class T {

    private Integer total;
    private Object rows;
    private Integer code;
    private String msg;

    public T(Integer total, Object rows, Integer code, String msg) {
        this.total = total;
        this.rows = rows;
        this.code = code;
        this.msg = msg;
    }

    public static T success(Integer total , String msg, Object rows) {

        return new T(total,rows,200, msg);

    }

    public static T error(String msg) {

        return new T(null,null ,500, msg);

    }


}
